<html>

<body>
    <input type="text" id="clock" />
    <script>
    var int = setInterval("clock()", 50);

    function clock() {
        var t = new Date();
        document.getElementById("clock").value = t
    }
    </script>
    <button onclick="int=window.clearInterval(int)">Stop interval</button>
</body>

</html>
